home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / ply15dat.zip / MARBLE.PI < prev    next >
Text File  |  1992-09-19  |  3KB  |  107 lines

  1. // Generic Polyray input File
  2. // Polyray input file: Alexander Enzmann
  3.  
  4. // Set up the camera
  5. viewpoint {
  6.    from <0, 0, -16>
  7.    at <0,0,0>
  8.    up <0,1,0>
  9.    angle 45
  10.    resolution 256, 256
  11.    }
  12.  
  13. background skyblue
  14. light 0.7*white, <-10, 3, -20>
  15. light 0.7*white, < 10, 3, -20>
  16.  
  17. define test_map
  18.    color_map(
  19.       [0,   0.3, red,     orange]
  20.       [0.1, 0.3, orange,  blue]
  21.       [0.3, 0.5, blue,    skyblue]
  22.       [0.5, 0.7, skyblue, orange]
  23.       [0.7, 0.9, orange,  magenta]
  24.       [0.9, 1.0, magenta, red],
  25.       <1, 1, 1>)
  26.  
  27. // Simple color map texture
  28. define noise_texture0
  29. texture {
  30.    special surface {
  31.       color test_map[noise(P)]
  32.       ambient 0.2
  33.       diffuse 0.8
  34.       specular white, 0.5
  35.       microfacet Reitz 10
  36.       }
  37.    scale <0.6, 0.6, 0.6>
  38.    }
  39.  
  40. define marble_turb 1
  41. define marble_fn  (sawtooth(P[0] + marble_turb * noise(P,4)) + 1) / 2
  42.  
  43. define white_marble_map
  44.    color_map(
  45.       [0.0, 0.8, <0.9, 0.9, 0.9>, <0.5, 0.5, 0.5>]
  46.       [0.8, 1.0, <0.5, 0.5, 0.5>, <0.2, 0.2, 0.2>])
  47.  
  48. define red_marble_map
  49.    color_map(
  50.       [0.0, 0.8, <0.8, 0.8, 0.6>, <0.8, 0.4, 0.4>]
  51.       [0.8, 1.0, <0.8, 0.4, 0.4>, <0.8, 0.2, 0.2>])
  52.  
  53. // Simple marble textures
  54. define white_marble_texture
  55. texture {
  56.    special surface {
  57.       color white_marble_map[marble_fn]
  58.       ambient 0.2
  59.       diffuse 0.8
  60.       specular white, 0.5
  61.       microfacet Reitz 10
  62.       }
  63.    }
  64.  
  65. define red_marble_texture
  66. texture {
  67.    special surface {
  68.       color red_marble_map[marble_fn]
  69.       ambient 0.2
  70.       diffuse 0.8
  71.       specular white, 0.5
  72.       microfacet Reitz 10
  73.       }
  74.    }
  75.  
  76. define wood_scale 2
  77. define light_wood <0.3, 0.12, 0.03>
  78. define dark_wood <0.05, 0.01, 0.005>
  79. define xydist wood_scale * sqrt(x * x + y * y)
  80.  
  81. define wood_turb 1
  82. define wood_fn  (sawtooth(xydist + wood_turb * noise(P,4)) + 1) / 2
  83.  
  84. define wood_map
  85.    color_map(
  86.       [0.0, 0.9, light_wood, light_wood]
  87.       [0.9, 1.0, light_wood, dark_wood])
  88.  
  89. define wood_texture
  90. texture {
  91.    special surface {
  92.       color wood_map[wood_fn]
  93.       ambient 0.2
  94.       diffuse 0.8
  95.       specular white, (0.4 + |wood_map[wood_fn]|)
  96.       microfacet Reitz 10
  97.       }
  98.    scale <0.3, 0.3, 0.3>
  99.    }
  100.  
  101. define two_sphere object { sphere <0, 0, 0>, 2 }
  102.  
  103. two_sphere { translate <-2.5, -2.5, 0> white_marble_texture }
  104. two_sphere { translate <-2.5,  2.5, 0> wood_texture }
  105. two_sphere { translate < 2.5, -2.5, 0> red_marble_texture }
  106. two_sphere { translate < 2.5,  2.5, 0> noise_texture0 }
  107.